The use of business rules and policies to externalize business and operational logic from an application is an important concept and approach to building large business applications and to new areas such as self-managing systems or autonomic computing systems. Business rules and policies are statements that are intended to be readable and modifiable by non-technical users and executable by an underlying mechanism such as a rule engine or a Java Virtual Machine (JVM), allowing application logic to be authored and modified external to the application.
One of the key aspects of using these business rules or policies is the ability to specify a priority for each of the rules in a set of business rules. A business rule set is a collection of rules selected and arranged to achieve a desired goal. Assigning a priority to each rule contained in the rule set controls the sequence of execution of rules in the rule set. Typically, priorities are initially established and assigned by a rule author; however, priority of the rules can be subsequently modified in accordance with application specific parameters, i.e. different situations and execution environments.
In a basic method of specifying the priority of each rule in a rule set, the rule author attaches a number, for example an integer value, to each rule that indicates the priority of that rule relative to the other rules in the rule set. The relationship between the attached number and the priority can be inverse such that the higher the number the lower the priority, or proportional such that the lower the number the lower the priority.
Priorities have been assigned to rules that are triggered based upon the occurrence of specified events or the value of specified parameters. Since the occurrence of a single event can trigger more than one rule, priorities are established among the rules to determine which of the rules are applied first. Therefore, even if multiple rules are triggered based upon the occurrence of an event, only the triggered rule with the highest established priority will be applied. For example, a first rule in a rule set, assigned a priority value of 2, offers a discount of 10% to customers that spend more then $100.00. The second rule, assigned a priority value of 1, offers a discount of 20% if the customer buys at least 10 items, and a third rule, assigned a priority value of 3, offers a discount of 25% if the customer buys at least 10 items in the month of December. The priority values indicate that the second rule is applied first followed by the first rule and then the third rule.
Priority has also been provided by arranging the rules in an ordered list by the desired order of execution. For example, a first rule offers a discount of 10% if the customer spends more than $100.00, and a second rule offers a discount of 20% if the customer buys at least 10 items. A third rule offers a discount of 25% during the month of December if the customer buys at 10 least items. Using this approach, the rule author is specifying that rule 1 is always executed first followed by rule 2 and then rule 3.
In addition to priority, additional constraints have been applied to each rule. The rule author can prescribe time periods for the enabling or disabling of the execution of a given rule. For example, the first rule wherein the customer is offered a 10% discount for spending more than $100.00 is scheduled to begin on January 1st and end on June 30th. The second rule wherein the customer is offered a discount of 10% for purchasing at least 10 items is scheduled to begin on July 1st and end on December 31st. The third rule wherein the customer is offered a discount of 25% for purchasing at least 10 items in the month of December is scheduled to begin on November 15th and to end on December 26th. Each of these three rules will only be executed on dates occurring within the prescribed time periods.
In addition to specifying time periods during which a given rule is either applied or not applied, it is often desired to vary the priority of a given rule relative to the other rules. For example, the third rule is given priority over the second rule during the holiday season, and, conversely, the second rule is given priority over the third rule at all other times of the year. Variable priority is achieved in the rule set of the proceeding paragraph, for example, by assigning a priority value of 2 to the first and second rules and a priority value of 1 to the third rule. However, the priority values assigned to the rules themselves are fixed, and do not vary over time.
Conventional rule ordering and priority systems express simple interrelationships among the rules in the rule set and fail to address the need to specify the varying of the priority value assigned to a rule using more complex functions. In particular, current rule authoring systems do not enable the application of time dependent priorities. As was illustrated in the proceeding paragraph, current rule authoring systems require a new or separate version of the rule for each time period and for each priority.
In addition to creating and expressing priorities among the plurality of rules in a given rule set, authoring systems attempt to provide for the manipulation of data. Data manipulation is used to model real-world or actual situations and variables that business users encounter. Traditionally, authoring and data manipulation systems were created by programmers for use by other programmers. Therefore, the interfaces are not business-user friendly, providing a format that is not natural, intuitive or easily understandable to a typical business user.
The intended progression of business rules expressed in more natural, non-formal language can be ambiguous or open to more than one interpretation. For example, the instruction to please hand someone the bat and the ball or the glove can be interpreted in at least two ways. This instruction can be interpreted to state that the person is to be handed the bat and ball or the bat and glove. Alternatively, the instruction can be interpreted to state that the person is to be handed the bat and the ball or just the glove. Additional information is needed to clarify how this instruction is to be interpreted.
Additional conjunctions, for example the conjunctions either or both, can be used to provide this additional information and to eliminate any ambiguity in the instruction. For example, the instruction can be reworded as the instruction to give someone the bat and either the ball or the glove. Alternatively, the instruction can be written as please give someone both the bat and the ball or the glove. However, even though the word both is utilized in the instruction, the instruction is still susceptible to two different interpretations.
Ambiguities can also be resolved through the use of generally accepted and widely applied precedence rules that convey the intended meaning unambiguously. An example of such precedence rules is found in the construction of algebraic expressions that use operator precedence to assign unambiguous meaning to a given expression. As long as the author and the reader are familiar with the established precedence, the meaning of a given algebraic expression is clearly conveyed. For example, the expression x=3+4×5 is understood to imply that 4 is multiplied by 5 followed by the addition of 3 since multiplication and division are performed first followed by addition and subtraction. Parentheses, however, are used to override the priority of multiplication and division. Thus, x=(3+2)×5 is interpreted to state that 3 and 2 are added together first and the resultant sum is multiplied by 5. Although universally accepted precedence is available when constructing algebraic expressions, similar precedence is not available when providing written directions or instructions as, for example, when constructing business rules.
Therefore, a need exists for a rule authoring system that provides for authoring of variable priorities for business rules and for the active and direct modification of the priorities by the author. Systems and structures are needed to communicate a desired hierarchy for written instructions or logical rules. Author interfaces are needed that are clear, concise and as consistent as possible with the thought processes of the business user. In addition, the tools that the business users are provided to interact with and manipulate the data are intuitive and understandable by the business user.